<?php
ob_start();
require_once '../sub/init.php';
require_once 'chkUadm.php';
if(!in_array('photo_m',$QXARR))exit(noauth());
require_once ZEAI.'cache/config_up.php';
require_once ZEAI.'sub/ZeaiUP.php';
if($submitok=='submitCut_success'){
	if(!ifint($uid))json_exit(array('flag'=>0,'msg'=>'uid为空，请刷新当前页面重新载入'));
	if(!empty($_cut)){
		//$shalou_photo_s = $row_shalou['photo_s'];
		$_s = cut_save('adm',$_cut,'m');
		//$row_shalou['photo_s']=$_s;
		//$jsonstr = encode_json($row_shalou);
		//$db->query("UPDATE ".__TBL_SHALOU__." SET jsonstr='$jsonstr',addtime=".ADDTIME." WHERE uid=".$uid);
		//删老
		//if(!empty($shalou_photo_s)){
		//	UP_modFn('adm','del',$shalou_photo_s.'|'.smb($shalou_photo_s,'m').'|'.smb($shalou_photo_s,'b').'|'.smb($shalou_photo_s,'blur'));
		//}
		AddLog('裁切头像【uid:'.$uid.'】');
		json_exit(array('flag'=>1,'msg'=>'裁切成功','_s'=>$_s));
	}else{
		json_exit(array('flag'=>0,'msg'=>'上传裁切更新失败'));
	}
}
$nav='index';
require_once ZEAI.'m/div_left_so.php';
?>
<!doctype html><html><head><meta charset="utf-8">
<title><?php echo $_ADM['admSiteName']; ?></title>
<?php echo HEADMETA; ?>
<script src="<?php echo RES;?>www_zeai_cn.js?<?php echo $_ZEAI['cache_str'];?>"></script>
<script src="<?php echo RES;?>m/js/m.js?<?php echo $_ZEAI['cache_str'];?>"></script>
<link href="<?php echo RES;?>m/css/m.css?<?php echo $_ZEAI['cache_str'];?>" rel="stylesheet" type="text/css" />
<?php require_once 'm_style.php';?>
<script>var MP='<?php echo MP;?>';</script>
<link href="css/m_adm.css?<?php echo $_ZEAI['cache_str'];?>" rel="stylesheet" type="text/css" />
<style>
.ZEAI_list{width:94%;margin:10px auto;padding:60px 0 80px;box-sizing:border-box;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;display:-webkit-flex;display:flex;-webkit-flex-wrap:wrap;flex-wrap:wrap;-webkit-justify-content:space-between;justify-content:initial}
.ZEAI_list li{width:40%;height:170px;line-height:100px;margin:10px 5% 20px 5%;background-color:#fff;position:relative;text-align:center;box-shadow:0 0 10px rgba(0,0,0,0.1);border-radius:5px}
.ZEAI_list li.pf0{height:190px}
.ZEAI_list li img{vertical-align:middle;max-width:100px;max-height:100px;box-sizing:border-box;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;}

.ZEAI_list li .del,.ZEAI_list li .mod{background:#fff;color:#aaa;border:#eee 1px solid;line-height:20px;width:20px;height:20px;top:-10px;right:-10px;position:absolute;border-radius:12px;display:block}
.ZEAI_list li .del:hover,.ZEAI_list li .mod:hover{color:#000;cursor:pointer}
.ZEAI_list li .del{font-size:12px}
.ZEAI_list li .mod{font-size:14px;top:25px;}

.ZEAI_list li a.pic{display:block;padding:5px 0}
.ZEAI_list li a.flag0{background-color:#ffc}

.ZEAI_list li .nickname,
.ZEAI_list li .chekbox{line-height:24px;height:24px;font-size:12px;color:#ddd;border-top:#f5f5f5 1px solid;font-family:'Verdana';overflow:hidden}
.ZEAI_list li .chekbox{padding:5px}

.ZEAI_list li .chekbox .l{float:left}
.ZEAI_list li .chekbox .l a{margin:0 6px 0 0}
.ZEAI_list li .chekbox .r{float:right}
.ZEAI_list li .chekbox .l a i{font-size:18px;color:#ccc}

.ZEAI_list li a span{display:block;width:100%;line-height:24px;position:absolute;top:28px;background-color:rgba(0,0,0,0.5);color:#aaa;font-size:12px}
.ZEAI_list li .flagstr{width:30px;line-height:20px;color:#fff;font-size:12px;position:absolute;top:6px;left:-2px;background-color:#f70}
.ZEAI_list li .flagstr,.ZEAI_list li .flagstr_1,.ZEAI_list li .RZstr_identity,.ZEAI_list li .RZstr_photo{width:30px;line-height:20px;color:#fff;font-size:12px;position:absolute;top:6px;left:-2px;background-color:#f70}
.ZEAI_list li .RZstr_identity,.ZEAI_list li .RZstr_photo{width:20px}
.ZEAI_list li .RZstr_identity{top:46px;background-color:#FD787B}
.ZEAI_list li .RZstr_photo{top:76px;background-color:#54A791}
.zdbox{margin:20px auto 0 auto;width:90%}
.zdbox button{margin:10px}
.ZEAI_list li .flagstr_1{width:55px;background-color:#333}
.ZEAI_list li .flagstr_f_1{background-color:#00f}
</style>
</head>
<body>
<?php
$SQL = "";
$Skey = trimhtml($Skey);
if (ifint($Skey)){
	$SQL = " AND (id=$Skey) ";
}elseif(!empty($Skey)){
	$SQL = " AND ( ( uname LIKE '%".$Skey."%' ) OR ( nickname LIKE '%".$Skey."%' ) OR ( nickname LIKE '%".urlencode($Skey)."%' ) )";
}
if ($t=='f0'){
	$SQL .= " AND photo_f=0 ";
}elseif($t=='f1'){
	$SQL .= " AND photo_f=1 ";
}elseif($t=='f_1'){
	$SQL .= " AND flag=-1 ";
}elseif($t=='f_2'){
	$SQL .= " AND flag=-2 ";
}
//
$rt = $db->query("SELECT id,nickname,sex,grade,mob,photo_s,photo_f,refresh_time,RZ,photo_ifshow,flag FROM ".__TBL_USER__." WHERE photo_s<>'' ".$SQL." ORDER BY photo_f ASC,refresh_time DESC LIMIT ".$_ADM['admLimit']);
$total = $db->num_rows($rt);
//
$mini_title='头像/置顶（'.$total.'）';$mini_class='top_mini4 ';
$mini_L = '<em onClick="zeai.openurl(\'m_adm.php\')"><i class="ico" >&#xeaca;</i><span></span></em>';
require_once ZEAI.'m/top_mini.php';?>
<a class="so" id="user_search"><i class="ico">&#xe66c;</i><span>筛选</span></a>

<form id="www_zeai_cn_FORM" class="ZEAI_list" method="get" action="<?php echo SELF; ?>">
	<?php
	if ($total <= 0 ) {
		echo "<div class='nodataico'><i class='ico'>&#xe608;</i>暂无信息<br><br><a class='aBAI' href='javascript:history.back(-1)'>返回上一步</a></div>";
	} else {
		$page_skin=2;$pagemode='mob';$pagesize=10;require_once ZEAI.'sub/page.php';
		for($i=1;$i<=$pagesize;$i++) {
			$rows = $db->fetch_array($rt);if(!$rows) break;
			$id        = $rows['id'];
			$uid       = $id;
			$nickname  = trimhtml(dataIO($rows['nickname'],'out'));
			$sex       = $rows['sex'];
			$grade     = $rows['grade'];
			$photo_s   = $rows['photo_s'];
			$photo_f   = $rows['photo_f'];
			$flag         = $rows['flag'];
			$photo_ifshow = $rows['photo_ifshow'];
			$RZ        = $rows['RZ'];$RZarr=explode(',',$RZ);
			$RZstr_identity =(in_array('identity',$RZarr))?'<div class="RZstr_identity" title="已实名认证"><font class="ico">&#xea2e;</font></div>':'';
			$RZstr_photo    =(in_array('photo',$RZarr))?'<div class="RZstr_photo" title="已真人认证"><font class="ico">&#xe645;</font></div>':'';
			//
			if(empty($nickname))$nickname = $uid;
			$nickname = str_replace($Skey,"<b class='Cf00'>".$Skey."</b>",$nickname);
			$dst_s    = $_ZEAI['up2'].'/'.$photo_s;
			$dst_b    = smb($dst_s,'b');
			if($photo_f == 0){
				$flagstr = '<div class="flagstr">未审</div>';
				$flagbg  = ' flag0';
			}else{
				$flagstr = '';
				$flagbg  = '';
			}
			$href    = mHref('crm_u',$uid);
			$flagstr = ($photo_ifshow == 0)?'<div class="flagstr_1">头像隐藏</div>':$flagstr;
			$flagstr = ($flag == -2)?'<div class="flagstr_1 flagstr_f_1">帐号隐藏</div>':$flagstr;
			$flagstr = ($flag == -1)?'<div class="flagstr_1 flagstr_f_1">锁定/注销</div>':$flagstr;?>
			<li id="tr<?php echo $id;?>">
			  <a href="javascript:;" onClick="ZeaiM.piczoom('<?php echo $dst_b;?>')" class="pic <?php echo $flagbg; ?>"><img src="<?php echo $dst_s;?>" class="img"></a>
			  <a href="javascript:;" class="del" pid="<?php echo $id;?>"><font class="ico">&#xe606;</font></a>
              <a href="m_u_mod.php?uid=<?php echo $uid;?>" class="mod"><font class="ico">&#xe610;</font></a>
			  <?php echo $flagstr.$RZstr_identity.$RZstr_photo; ?>
			  <div class="nickname"><a href="<?php echo $href;?>" class="C999"><?php echo uicon($sex.$grade).' '.$nickname;?></a></div>
			  <div class="chekbox">
				<div class="l">
                    <a href="javascript:cut(<?php echo $uid; ?>,'<?php echo smb($photo_s,'b'); ?>');" title="裁切头像"><i class="ico">&#xe6a5;</i> </a>
                    <a href="javascript:send_msg(<?php echo $uid; ?>,'<?php echo $nickname; ?>');" title="发送消息"><i class="ico">&#xe676;</i></a>
                    <a href="photo_m.php?uid=<?php echo $uid; ?>&submitok=updateendtime&p=<?php echo $p; ?>" title="置顶排名"><i class="ico">&#xe632;</i></a>
                    <a href="javascript:;" class="abottom" uid="<?php echo $uid; ?>" p="<?php echo $p; ?>" title="置底排名"><i class="ico">&#xe63c;</i></a>
                </div>
				<div class="r">
                      <input type="checkbox" class="checkskin" name="list[]" value="<?php echo $id; ?>" id="chk<?php echo $id; ?>" onclick="chkbox(<?php echo $i; ?>,<?php echo $id; ?>)"><label for="chk<?php echo $id; ?>" class="checkskin-label" title="选择"><i class="i1"></i></label>
				 </div>
				</div>
			  </li>
		<?php	
		}
	}
	?>
</form>
<script>var bg = '<?php echo $_Style['list_bg']; ?>',overbg   = '<?php echo $_Style['list_overbg']; ?>',selectbg = '<?php echo $_Style['list_selectbg']; ?>';</script>

<!--div_left_so-->
<div id="rangebox"></div>
<div class="div_left_so" id="user_so">
	<form action="m_photo_m.php" method="get" name="www.yzlove.com" id="ZEAI_CN_FORM_ext">
    	<div class="form_uid">
        <input name="Skey" type="text" class="input" id="Skey" maxlength="20" value="<?php echo $Skey;?>" placeholder="按UID/用户名/昵称" autocomplete="off">
        <button type="submit" class="ico">&#xe6c4;</button>
		</div>
        <?php
		div_left_so_out(array('tbody'=>'审核状态','t'=>'t','tv'=>$t,'subkind'=>2,'newarr'=>json_decode('[{"i":"f0","v":"未审"},{"i":"f1","v":"已审"}]'),'ulcls'=>' col3'));
		?>
        <script>div_left_so_init('user_so')</script>
        <div class="savebox"><button type="button" class="btn size3 reset" onClick="div_left_so_reset('user_so')">重置</button><button type="submit" class="btn size3 zeaibg ico">&#xe6c4; 确定</button></div>
    </form>
</div>
<script>user_search.onclick=function(){ZeaiM.div_left({obj:user_so,w:28});}</script>
<!--div_left_so end-->


<?php if ($total > 0 ) {?>
<div id="backtop"><a id="btmTopBtn"><i class="ico">&#xe60c;</i>顶部</a></div>
<?php echo $page_cls;?>
<div class="listbottombox">
	<input type="checkbox" id="checkboxall2" class="checkskin checkboxall"><label for="checkboxall2" class="checkskin-label"><i class="i1"></i></label>　
    <button type="button" class="btn size2 zeaibg disabled action"  id="btnflag">审核</button>&nbsp;&nbsp;
   <!-- <button type="button" class="btn size2 HEI2 disabled action" id="btndellist">删除</button>-->
    <button type="button" id="btnsend" value="" class="btn size2 zeaibg disabled action" onClick="sendTipFn(this);">发消息</button>
	<?php if ($total > $pagesize)echo '<div class="pagebox">'.$pagelist.'</div>'; ?>
</div>
<script>
/*o('btndellist').onclick = function() {
	allList({
		btnobj:this,
		url:'photo_m'+zeai.ajxext+'submitok=alldel',
		title:'批量删除',
		content:'<br>删除后无法恢复，将自动发送驳回信息（微信通知和站内信），引导用户重新上传',
		msg:'正在删除中...',
		ifjson:true,
		ifconfirm:true
	});	
}
*/
o('btnflag').onclick = function() {
	allList({
		btnobj:this,
		url:'photo_m'+zeai.ajxext+'submitok=allflag1',
		title:'批量审核',
		content:'此操作将发送照片消息提醒推送，过程可能有点慢，请不要关闭窗口耐心等待。',
		msg:'正在审核中...',
		ifjson:true,
		ifconfirm:false
	});	
}
zeai.listEach('.del',function(obj){
	obj.onclick = function(){
		var id = parseInt(obj.getAttribute("pid"));
		zeai.confirm('<b>确定要删除么(无法恢复)</b>？<br>删除后将自动发送驳回信息（微信通知和站内信），引导用户重新上传',function(){
			zeai.ajax('photo_m'+zeai.ajxext+'submitok=alldel&list[]='+id,function(e){var rs=zeai.jsoneval(e);
				if (rs.flag == 1){location.reload(true);}else{zeai.msg(rs.msg);}
			});
		});
	}
});
function send_msg(uid,nkname) {ZeaiM.iframe({title:'发送消息',url:'u_tip.php?ulist='+uid});}
zeai.listEach('.abottom',function(obj){
	obj.onclick = function(){
		var uid = parseInt(obj.getAttribute("uid")),
		p = parseInt(obj.getAttribute("p"));
		zeai.iframe('【'+uid+'】排序置底','photo_m'+zeai.ajxext+'submitok=downtime&p='+p+'&uid='+uid,300,300);
	}
});
var up2='<?php echo UP;?>',upurl='<?php echo SELF;?>';
function cut(id,photo_b) {
	var dbname = photo_b;
	ZeaiM.div_left({obj:cut_box,w:zeai.bodyW()});
	cut_tmppic.src=up2+dbname;
	www_a9a_cn_cut = new ZEAICUT(id);
	www_a9a_cn_cut.wake();
	www_a9a_cn_cut.init();
}
</script>
<script src="js/zeai_tablelist.js?<?php echo $_ZEAI['cache_str'];?>"></script>
<?php }
require_once ZEAI.'res/m/cut.html';
?>
</body></html><?php ob_end_flush();?>